package edu.washington.tcss360.burningpenguins.client;

import java.util.Arrays;
import java.util.LinkedList;

import edu.washington.tcss360.burningpenguins.data.DataObject;
import edu.washington.tcss360.burningpenguins.data.ReviewDesignation;
import edu.washington.tcss360.burningpenguins.database.BPDatabaseConnection;
import edu.washington.tcss360.burningpenguins.queries.QueryBy;
import edu.washington.tcss360.burningpenguins.util.DataObjectField;
import edu.washington.tcss360.burningpenguins.util.DataObjectFieldDataType;

/**
 * A class for performing operations on the ReviewDesignation table.
 * 
 * @author Chris Gelatt
 * @version 1.0
 * @since 2013-12-03
 *
 */
public class ReviewDesignationClient extends DataObjectClient
{
	public ReviewDesignationClient(BPDatabaseConnection connection)
	{
		super(connection);
		tableName = "ReviewDesignation";
		classPath = "edu.washington.tcss360.burningpenguins.data.ReviewDesignation";
		validQueries = new LinkedList<>();
		objectFields = new LinkedList<>();
		
		//TODO - Populate valid queries
		
		objectFields.add(new DataObjectField("ConferenceId", "ConferenceId", DataObjectFieldDataType.INTEGER, true));
		objectFields.add(new DataObjectField("UserId", "UserId", DataObjectFieldDataType.INTEGER, true));
		objectFields.add(new DataObjectField("PaperId", "PaperId", DataObjectFieldDataType.INTEGER, true));
	}
	
	/**
	 * {@inheritDoc}
	 */
	public ReviewDesignation get(Integer id)
	{
		return (ReviewDesignation)getBase(id);
	}
	
	/**
	 * {@inheritDoc}
	 */
	public ReviewDesignation[] getAll(QueryBy[] dbQueries)
	{
		DataObject[] baseArray = getAllBase(dbQueries);
		return Arrays.copyOf(baseArray, baseArray.length, ReviewDesignation[].class);
	}
}
